#!/usr/bin/env python3
#-*-encoding:utf-8-*-

import os

#清空控制台
def clear():
    print("\033c",end="")
#递归法实现数据递减
def countdown(i):
    print(i)
    if i == 0 :
        return 
    else :
        countdown(i-1)

#递归求阶乘
def fact(x):
    if x == 1:
        return 1
    else :
        return x * fact(x-1)

#递归法求数组各元素之和
def sumArr(arr):
    if len(arr) == 1 :
        return arr[0]
    else :
        return arr.pop(0) + sumArr(arr)
# ----------------------------------------------
clear()  #清屏
mlist=[1,2,3]
countdown(5)
print( fact(100) )

print(sumArr(mlist))



